<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // console.log(window.name)

    //1.声明
    let LI = {
      "uname": 'lishenghao', //属性 :（冒号）属性值  俩属性之间逗号隔开
      age: 18,
      gender: '男' //最后一个对象不用逗号
    }
    console.log(typeof LI)
    console.log(LI)
    // 使用属性
    //2.查  对象名.属性名
    console.log(LI.uname)
    console.log(LI.age)
    console.log(LI.gender)
    console.log(LI['uname'])
    console.log('--------------------------------------')
    // 查总结:
    // (1)对象名.属性名     LI.age
    console.log(LI.age)
    // (2)对象名['属性名']  LI['age'] 或 LI["age"]
    console.log(LI['age'])
    console.log('--------------------------------------')
    //3.改  对象名.属性名 = 新值
    LI.gender = '女'
    console.log(LI.gender)
    console.log(LI)
    //4.增  对象名.新属性名 = 新值
    LI.hobby = '道冠'
    console.log(LI.hobby)
    console.log(LI)
    //5.删(了解即可)  delete 对象名.属性名
    delete LI.hobby
    console.log(LI.hobby)
    console.log(LI)
    console.log('------------------------------------------------')
    let obj = {
      uanme: '小米10青春版',
      num: '100012816024',
      weight: '0.55kg',
      address: '中国大陆'
    }
    obj.uanme = '小米10 PLUS'
    obj.color = '粉色'
    console.log(obj)
    console.log(obj.uanme)
    console.log(obj.num)
    console.log(obj.weight)
    console.log(obj.address)
    console.log(obj.color)

  </script>
</body>

</html>